Libraries 📚⬇¶

In [1]:
from google.colab import drive
drive.mount('/content/drive')
Mounted at /content/drive
In [2]:
%cd /content/drive/MyDrive/workspace/Yolov5/new
/content/drive/MyDrive/workspace/Yolov5/new
In [3]:
# !mkdir car
%cd car
/content/drive/MyDrive/workspace/Yolov5/new/car
In [4]:
import os, time, random
import numpy as np
import pandas as pd
import cv2, torch
from tqdm.auto import tqdm
import shutil as sh

from IPython.display import Image, clear_output
import matplotlib.pyplot as plt
%matplotlib inline
In [5]:
%%time

# !git clone https://github.com/ultralytics/yolov5  # clone repo
!pip install -U pycocotools
!pip install -qr yolov5/requirements.txt  # install dependencies
!cp yolov5/requirements.txt ./
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Requirement already satisfied: pycocotools in /usr/local/lib/python3.10/dist-packages (2.0.6)
Requirement already satisfied: matplotlib>=2.1.0 in /usr/local/lib/python3.10/dist-packages (from pycocotools) (3.7.1)
Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from pycocotools) (1.22.4)
Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.1.0->pycocotools) (1.0.7)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.1.0->pycocotools) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.1.0->pycocotools) (4.39.3)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.1.0->pycocotools) (1.4.4)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.1.0->pycocotools) (23.1)
Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.1.0->pycocotools) (8.4.0)
Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.1.0->pycocotools) (3.0.9)
Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.1.0->pycocotools) (2.8.2)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.7->matplotlib>=2.1.0->pycocotools) (1.16.0)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 184.3/184.3 kB 4.8 MB/s eta 0:00:00
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.7/62.7 kB 6.5 MB/s eta 0:00:00
CPU times: user 106 ms, sys: 11.5 ms, total: 117 ms
Wall time: 10.7 s

Loading Data 📝 / Preprocessing ⚙️¶

In [6]:
img_h, img_w, num_channels = (380, 676, 3)
df = pd.read_csv('/content/drive/MyDrive/workspace/Yolov5/new/data/train_solution_bounding_boxes (1).csv')
df.rename(columns={'image':'image_id'}, inplace=True)
df['image_id'] = df['image_id'].apply(lambda x: x.split('.')[0])
print(df.head())
      image_id        xmin        ymin        xmax        ymax
0   vid_4_1000  281.259045  187.035071  327.727931  223.225547
1  vid_4_10000   15.163531  187.035071  120.329957  236.430180
2  vid_4_10040  239.192475  176.764801  361.968162  236.430180
3  vid_4_10020  496.483358  172.363256  630.020260  231.539575
4  vid_4_10060   16.630970  186.546010  132.558611  238.386422
In [7]:
df['x_center'] = (df['xmin'] + df['xmax'])/2
In [8]:
df['y_center'] = (df['ymin'] + df['ymax'])/2
df['w'] = df['xmax'] - df['xmin']
df['h'] = df['ymax'] - df['ymin']
df['classes'] = 0
df['x_center'] = df['x_center']/img_w
df['w'] = df['w']/img_w
df['y_center'] = df['y_center']/img_h
df['h'] = df['h']/img_h
df.head()
Out[8]:
image_id xmin ymin xmax ymax x_center y_center w h classes
0 vid_4_1000 281.259045 187.035071 327.727931 223.225547 0.450434 0.539817 0.068741 0.095238 0
1 vid_4_10000 15.163531 187.035071 120.329957 236.430180 0.100217 0.557191 0.155572 0.129987 0
2 vid_4_10040 239.192475 176.764801 361.968162 236.430180 0.444645 0.543678 0.181621 0.157014 0
3 vid_4_10020 496.483358 172.363256 630.020260 231.539575 0.833213 0.531451 0.197540 0.155727 0
4 vid_4_10060 16.630970 186.546010 132.558611 238.386422 0.110347 0.559122 0.171491 0.136422 0
In [9]:
index = list(set(df.image_id))
image = random.choice(index)
print("Image ID: %s"%(image))
img = cv2.imread(f'/content/drive/MyDrive/workspace/Yolov5/new/data/training_images/{image}.jpg')
img.shape
Image ID: vid_4_21600
Out[9]:
(380, 676, 3)
In [10]:
image = random.choice(index)
Image(filename=f'/content/drive/MyDrive/workspace/Yolov5/new/data/training_images/{image}.jpg',width=600)
Out[10]:

Training (Work in Progress)¶

In [11]:
import os
import shutil as sh
from tqdm import tqdm

source = 'training_images'
# os.makedirs('/data')

folds = [0]  # Define the list of fold values here

for fold in folds:
    # os.makedirs('/data/fold{}'.format(fold))
    val_index = index[len(index)*fold//5:len(index)*(fold+1)//5]
    for name, mini in tqdm(df.groupby('image_id')):
        if name in val_index:
            path2save = 'val2017/'
        else:
            path2save = 'train2017/'
        if not os.path.exists('data/fold{}/labels/'.format(fold)+path2save):
            os.makedirs('data/fold{}/labels/'.format(fold)+path2save)
        with open('data/fold{}/labels/'.format(fold)+path2save+name+".txt", 'w+') as f:
            row = mini[['classes','x_center','y_center','w','h']].astype(float).values
            row = row.astype(str)
            for j in range(len(row)):
                text = ' '.join(row[j])
                f.write(text)
                f.write("\n")
        if not os.path.exists('data/fold{}/images/{}'.format(fold,path2save)):
            os.makedirs('data/fold{}/images/{}'.format(fold,path2save))
        sh.copy("/content/drive/MyDrive/workspace/Yolov5/new/data/{}/{}.jpg".format(source,name),'data/fold{}/images/{}/{}.jpg'.format(fold,path2save,name))
100%|██████████| 355/355 [02:45<00:00,  2.15it/s]
In [12]:
!ls data/fold0/images/train2017
vid_4_10000.jpg  vid_4_16180.jpg  vid_4_21540.jpg  vid_4_600.jpg
vid_4_1000.jpg	 vid_4_16280.jpg  vid_4_21560.jpg  vid_4_6160.jpg
vid_4_10020.jpg  vid_4_16300.jpg  vid_4_21580.jpg  vid_4_6180.jpg
vid_4_10040.jpg  vid_4_16320.jpg  vid_4_21600.jpg  vid_4_6200.jpg
vid_4_10060.jpg  vid_4_16400.jpg  vid_4_2160.jpg   vid_4_6220.jpg
vid_4_10100.jpg  vid_4_16420.jpg  vid_4_21620.jpg  vid_4_6240.jpg
vid_4_10120.jpg  vid_4_16500.jpg  vid_4_21640.jpg  vid_4_6260.jpg
vid_4_10140.jpg  vid_4_16660.jpg  vid_4_21660.jpg  vid_4_6280.jpg
vid_4_1020.jpg	 vid_4_16680.jpg  vid_4_21680.jpg  vid_4_6300.jpg
vid_4_1040.jpg	 vid_4_16700.jpg  vid_4_2180.jpg   vid_4_6320.jpg
vid_4_10480.jpg  vid_4_16720.jpg  vid_4_2200.jpg   vid_4_6340.jpg
vid_4_10500.jpg  vid_4_17040.jpg  vid_4_22220.jpg  vid_4_6360.jpg
vid_4_10520.jpg  vid_4_17060.jpg  vid_4_22240.jpg  vid_4_6380.jpg
vid_4_1060.jpg	 vid_4_17080.jpg  vid_4_22540.jpg  vid_4_6400.jpg
vid_4_10960.jpg  vid_4_17100.jpg  vid_4_22560.jpg  vid_4_6420.jpg
vid_4_10980.jpg  vid_4_17120.jpg  vid_4_22580.jpg  vid_4_6440.jpg
vid_4_11000.jpg  vid_4_17140.jpg  vid_4_22640.jpg  vid_4_6480.jpg
vid_4_11020.jpg  vid_4_17160.jpg  vid_4_22660.jpg  vid_4_6500.jpg
vid_4_11240.jpg  vid_4_17180.jpg  vid_4_22700.jpg  vid_4_6520.jpg
vid_4_11260.jpg  vid_4_17240.jpg  vid_4_22720.jpg  vid_4_680.jpg
vid_4_11280.jpg  vid_4_17260.jpg  vid_4_22740.jpg  vid_4_700.jpg
vid_4_11380.jpg  vid_4_17320.jpg  vid_4_22980.jpg  vid_4_740.jpg
vid_4_11400.jpg  vid_4_17340.jpg  vid_4_23000.jpg  vid_4_8220.jpg
vid_4_11420.jpg  vid_4_17360.jpg  vid_4_2380.jpg   vid_4_8240.jpg
vid_4_11440.jpg  vid_4_17400.jpg  vid_4_2400.jpg   vid_4_8260.jpg
vid_4_11880.jpg  vid_4_17420.jpg  vid_4_2420.jpg   vid_4_8280.jpg
vid_4_11900.jpg  vid_4_17440.jpg  vid_4_24760.jpg  vid_4_8300.jpg
vid_4_11920.jpg  vid_4_17540.jpg  vid_4_2540.jpg   vid_4_8320.jpg
vid_4_11940.jpg  vid_4_17560.jpg  vid_4_26300.jpg  vid_4_8340.jpg
vid_4_11960.jpg  vid_4_17580.jpg  vid_4_26320.jpg  vid_4_8560.jpg
vid_4_11980.jpg  vid_4_17600.jpg  vid_4_26340.jpg  vid_4_8580.jpg
vid_4_12000.jpg  vid_4_1760.jpg   vid_4_26360.jpg  vid_4_8600.jpg
vid_4_12040.jpg  vid_4_17620.jpg  vid_4_26380.jpg  vid_4_860.jpg
vid_4_12060.jpg  vid_4_17640.jpg  vid_4_26400.jpg  vid_4_8640.jpg
vid_4_12080.jpg  vid_4_17660.jpg  vid_4_26420.jpg  vid_4_8660.jpg
vid_4_12100.jpg  vid_4_17680.jpg  vid_4_26440.jpg  vid_4_8680.jpg
vid_4_12120.jpg  vid_4_1780.jpg   vid_4_26460.jpg  vid_4_8700.jpg
vid_4_12140.jpg  vid_4_1800.jpg   vid_4_26480.jpg  vid_4_8720.jpg
vid_4_12160.jpg  vid_4_18180.jpg  vid_4_26500.jpg  vid_4_8740.jpg
vid_4_12180.jpg  vid_4_18200.jpg  vid_4_26520.jpg  vid_4_880.jpg
vid_4_12200.jpg  vid_4_1820.jpg   vid_4_26540.jpg  vid_4_8960.jpg
vid_4_12220.jpg  vid_4_18320.jpg  vid_4_26560.jpg  vid_4_8980.jpg
vid_4_12240.jpg  vid_4_18360.jpg  vid_4_26580.jpg  vid_4_9000.jpg
vid_4_12260.jpg  vid_4_1840.jpg   vid_4_28200.jpg  vid_4_900.jpg
vid_4_12280.jpg  vid_4_1860.jpg   vid_4_28220.jpg  vid_4_9020.jpg
vid_4_12300.jpg  vid_4_1880.jpg   vid_4_28240.jpg  vid_4_9040.jpg
vid_4_12320.jpg  vid_4_18820.jpg  vid_4_28440.jpg  vid_4_9060.jpg
vid_4_12340.jpg  vid_4_18840.jpg  vid_4_28820.jpg  vid_4_9080.jpg
vid_4_12360.jpg  vid_4_18860.jpg  vid_4_28840.jpg  vid_4_9200.jpg
vid_4_12380.jpg  vid_4_18880.jpg  vid_4_28860.jpg  vid_4_920.jpg
vid_4_12480.jpg  vid_4_1900.jpg   vid_4_28880.jpg  vid_4_9220.jpg
vid_4_13580.jpg  vid_4_19040.jpg  vid_4_29460.jpg  vid_4_9240.jpg
vid_4_13620.jpg  vid_4_19060.jpg  vid_4_29480.jpg  vid_4_9260.jpg
vid_4_13640.jpg  vid_4_19080.jpg  vid_4_29500.jpg  vid_4_9280.jpg
vid_4_13660.jpg  vid_4_1920.jpg   vid_4_29520.jpg  vid_4_9300.jpg
vid_4_13680.jpg  vid_4_1940.jpg   vid_4_29540.jpg  vid_4_9320.jpg
vid_4_13700.jpg  vid_4_1960.jpg   vid_4_29560.jpg  vid_4_9340.jpg
vid_4_13740.jpg  vid_4_19740.jpg  vid_4_29880.jpg  vid_4_940.jpg
vid_4_13760.jpg  vid_4_19760.jpg  vid_4_29900.jpg  vid_4_9420.jpg
vid_4_13780.jpg  vid_4_19780.jpg  vid_4_29920.jpg  vid_4_9440.jpg
vid_4_13800.jpg  vid_4_1980.jpg   vid_4_29940.jpg  vid_4_9460.jpg
vid_4_13820.jpg  vid_4_19880.jpg  vid_4_29960.jpg  vid_4_9500.jpg
vid_4_13840.jpg  vid_4_19900.jpg  vid_4_29980.jpg  vid_4_9520.jpg
vid_4_13860.jpg  vid_4_19920.jpg  vid_4_30000.jpg  vid_4_9540.jpg
vid_4_13880.jpg  vid_4_2000.jpg   vid_4_30020.jpg  vid_4_9560.jpg
vid_4_13900.jpg  vid_4_2020.jpg   vid_4_30440.jpg  vid_4_9580.jpg
vid_4_14140.jpg  vid_4_2040.jpg   vid_4_3120.jpg   vid_4_9600.jpg
vid_4_14160.jpg  vid_4_2060.jpg   vid_4_3140.jpg   vid_4_960.jpg
vid_4_14340.jpg  vid_4_2080.jpg   vid_4_3160.jpg   vid_4_9640.jpg
vid_4_14360.jpg  vid_4_2100.jpg   vid_4_3180.jpg   vid_4_9660.jpg
vid_4_14380.jpg  vid_4_21160.jpg  vid_4_3200.jpg   vid_4_9700.jpg
vid_4_14400.jpg  vid_4_21180.jpg  vid_4_3220.jpg   vid_4_9720.jpg
vid_4_14440.jpg  vid_4_2120.jpg   vid_4_3240.jpg   vid_4_9740.jpg
vid_4_14460.jpg  vid_4_21220.jpg  vid_4_3260.jpg   vid_4_9780.jpg
vid_4_14480.jpg  vid_4_21240.jpg  vid_4_3340.jpg   vid_4_9800.jpg
vid_4_14500.jpg  vid_4_21260.jpg  vid_4_3360.jpg   vid_4_980.jpg
vid_4_15000.jpg  vid_4_21280.jpg  vid_4_3380.jpg   vid_4_9820.jpg
vid_4_15020.jpg  vid_4_21300.jpg  vid_4_3460.jpg   vid_4_9840.jpg
vid_4_15040.jpg  vid_4_21320.jpg  vid_4_3520.jpg   vid_4_9860.jpg
vid_4_16000.jpg  vid_4_21400.jpg  vid_4_3540.jpg   vid_4_9880.jpg
vid_4_16020.jpg  vid_4_2140.jpg   vid_4_3560.jpg   vid_4_9900.jpg
vid_4_16040.jpg  vid_4_21420.jpg  vid_4_3800.jpg   vid_4_9960.jpg
vid_4_16060.jpg  vid_4_21440.jpg  vid_4_3820.jpg   vid_4_9980.jpg
vid_4_16120.jpg  vid_4_21480.jpg  vid_4_3840.jpg
vid_4_16140.jpg  vid_4_21500.jpg  vid_4_4520.jpg
vid_4_16160.jpg  vid_4_21520.jpg  vid_4_4540.jpg
In [13]:
%%writefile dataset.yaml
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: ../data/fold0/  # dataset root dir
train: images/train2017 # train images (relative to 'path') 128 images
val: images/val2017  # val images (relative to 'path') 128 images
test:  # test images (optional)

# Classes (80 COCO classes)
names:
  0: car
Overwriting dataset.yaml
In [14]:
!python yolov5/train.py --batch 12 --epochs 12 --data dataset.yaml --weights yolov5s.pt --name yolov5x_fold0_new
train: weights=yolov5s.pt, cfg=, data=dataset.yaml, hyp=yolov5/data/hyps/hyp.scratch-low.yaml, epochs=12, batch_size=12, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, noplots=False, evolve=None, bucket=, cache=None, image_weights=False, device=, multi_scale=False, single_cls=False, optimizer=SGD, sync_bn=False, workers=8, project=yolov5/runs/train, name=yolov5x_fold0_new, exist_ok=False, quad=False, cos_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, seed=0, local_rank=-1, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest
github: up to date with https://github.com/ultralytics/yolov5 ✅
YOLOv5 🚀 v7.0-163-g016e046 Python-3.10.11 torch-2.0.0+cu118 CPU

hyperparameters: lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0
ClearML: run 'pip install clearml' to automatically track, visualize and remotely train YOLOv5 🚀 in ClearML
Comet: run 'pip install comet_ml' to automatically track and visualize YOLOv5 🚀 runs in Comet
TensorBoard: Start with 'tensorboard --logdir yolov5/runs/train', view at http://localhost:6006/
Downloading https://ultralytics.com/assets/Arial.ttf to /root/.config/Ultralytics/Arial.ttf...
100% 755k/755k [00:00<00:00, 16.7MB/s]
Overriding model.yaml nc=80 with nc=1

                 from  n    params  module                                  arguments                     
  0                -1  1      3520  models.common.Conv                      [3, 32, 6, 2, 2]              
  1                -1  1     18560  models.common.Conv                      [32, 64, 3, 2]                
  2                -1  1     18816  models.common.C3                        [64, 64, 1]                   
  3                -1  1     73984  models.common.Conv                      [64, 128, 3, 2]               
  4                -1  2    115712  models.common.C3                        [128, 128, 2]                 
  5                -1  1    295424  models.common.Conv                      [128, 256, 3, 2]              
  6                -1  3    625152  models.common.C3                        [256, 256, 3]                 
  7                -1  1   1180672  models.common.Conv                      [256, 512, 3, 2]              
  8                -1  1   1182720  models.common.C3                        [512, 512, 1]                 
  9                -1  1    656896  models.common.SPPF                      [512, 512, 5]                 
 10                -1  1    131584  models.common.Conv                      [512, 256, 1, 1]              
 11                -1  1         0  torch.nn.modules.upsampling.Upsample    [None, 2, 'nearest']          
 12           [-1, 6]  1         0  models.common.Concat                    [1]                           
 13                -1  1    361984  models.common.C3                        [512, 256, 1, False]          
 14                -1  1     33024  models.common.Conv                      [256, 128, 1, 1]              
 15                -1  1         0  torch.nn.modules.upsampling.Upsample    [None, 2, 'nearest']          
 16           [-1, 4]  1         0  models.common.Concat                    [1]                           
 17                -1  1     90880  models.common.C3                        [256, 128, 1, False]          
 18                -1  1    147712  models.common.Conv                      [128, 128, 3, 2]              
 19          [-1, 14]  1         0  models.common.Concat                    [1]                           
 20                -1  1    296448  models.common.C3                        [256, 256, 1, False]          
 21                -1  1    590336  models.common.Conv                      [256, 256, 3, 2]              
 22          [-1, 10]  1         0  models.common.Concat                    [1]                           
 23                -1  1   1182720  models.common.C3                        [512, 512, 1, False]          
 24      [17, 20, 23]  1     16182  models.yolo.Detect                      [1, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [128, 256, 512]]
Model summary: 214 layers, 7022326 parameters, 7022326 gradients, 15.9 GFLOPs

Transferred 343/349 items from yolov5s.pt
optimizer: SGD(lr=0.01) with parameter groups 57 weight(decay=0.0), 60 weight(decay=0.00046875), 60 bias
albumentations: Blur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01), CLAHE(p=0.01, clip_limit=(1, 4.0), tile_grid_size=(8, 8))
train: Scanning /content/drive/MyDrive/workspace/Yolov5/new/car/data/fold0/labels/train2017... 341 images, 0 backgrounds, 0 corrupt: 100% 341/341 [00:10<00:00, 31.12it/s]
train: New cache created: /content/drive/MyDrive/workspace/Yolov5/new/car/data/fold0/labels/train2017.cache
val: Scanning /content/drive/MyDrive/workspace/Yolov5/new/car/data/fold0/labels/val2017... 128 images, 0 backgrounds, 0 corrupt: 100% 128/128 [00:09<00:00, 13.44it/s]
val: New cache created: /content/drive/MyDrive/workspace/Yolov5/new/car/data/fold0/labels/val2017.cache

AutoAnchor: 4.96 anchors/target, 1.000 Best Possible Recall (BPR). Current anchors are a good fit to dataset ✅
Plotting labels to yolov5/runs/train/yolov5x_fold0_new2/labels.jpg... 
Image sizes 640 train, 640 val
Using 2 dataloader workers
Logging results to yolov5/runs/train/yolov5x_fold0_new2
Starting training for 12 epochs...

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
       0/11         0G     0.1036      0.033          0         14        640: 100% 29/29 [08:26<00:00, 17.45s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/6 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 1.700s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 6/6 [00:45<00:00,  7.53s/it]
                   all        128        201      0.292      0.398      0.364     0.0989

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
       1/11         0G    0.07688    0.02839          0         15        640: 100% 29/29 [08:06<00:00, 16.79s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 6/6 [00:40<00:00,  6.73s/it]
                   all        128        201       0.64      0.443      0.497      0.181

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
       2/11         0G    0.07302    0.02308          0         13        640: 100% 29/29 [08:18<00:00, 17.18s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 6/6 [00:38<00:00,  6.44s/it]
                   all        128        201      0.313      0.667      0.289      0.109

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
       3/11         0G     0.0698    0.02137          0         23        640: 100% 29/29 [08:09<00:00, 16.86s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 6/6 [00:36<00:00,  6.09s/it]
                   all        128        201      0.504      0.781      0.582      0.199

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
       4/11         0G     0.0631    0.01999          0         10        640: 100% 29/29 [08:15<00:00, 17.09s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 6/6 [00:35<00:00,  5.95s/it]
                   all        128        201       0.93      0.865      0.945      0.507

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
       5/11         0G    0.05432     0.0171          0         13        640: 100% 29/29 [08:13<00:00, 17.03s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 6/6 [00:35<00:00,  5.88s/it]
                   all        128        201      0.869      0.866       0.88      0.344

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
       6/11         0G    0.04788     0.0167          0         14        640: 100% 29/29 [08:05<00:00, 16.75s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 6/6 [00:35<00:00,  5.93s/it]
                   all        128        201       0.97      0.966      0.982      0.408

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
       7/11         0G    0.04259    0.01465          0         15        640: 100% 29/29 [08:01<00:00, 16.61s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 6/6 [00:36<00:00,  6.16s/it]
                   all        128        201      0.949      0.935      0.958      0.422

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
       8/11         0G    0.04038    0.01438          0          8        640: 100% 29/29 [08:06<00:00, 16.78s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 6/6 [00:34<00:00,  5.78s/it]
                   all        128        201      0.942      0.945      0.973      0.578

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
       9/11         0G    0.03532     0.0132          0         17        640: 100% 29/29 [08:12<00:00, 16.97s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 6/6 [00:36<00:00,  6.00s/it]
                   all        128        201      0.937      0.965      0.975      0.591

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
      10/11         0G    0.03439    0.01324          0         11        640: 100% 29/29 [08:05<00:00, 16.73s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 6/6 [00:34<00:00,  5.79s/it]
                   all        128        201       0.97      0.962      0.988      0.564

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
      11/11         0G    0.03145    0.01259          0         15        640: 100% 29/29 [08:08<00:00, 16.83s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 6/6 [00:35<00:00,  5.87s/it]
                   all        128        201      0.985       0.98      0.992      0.659

12 epochs completed in 1.762 hours.
Optimizer stripped from yolov5/runs/train/yolov5x_fold0_new2/weights/last.pt, 14.3MB
Optimizer stripped from yolov5/runs/train/yolov5x_fold0_new2/weights/best.pt, 14.3MB

Validating yolov5/runs/train/yolov5x_fold0_new2/weights/best.pt...
Fusing layers... 
Model summary: 157 layers, 7012822 parameters, 0 gradients, 15.8 GFLOPs
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 6/6 [00:36<00:00,  6.06s/it]
                   all        128        201      0.985       0.98      0.992       0.66
Results saved to yolov5/runs/train/yolov5x_fold0_new2

Stats¶

In [15]:
!ls yolov5/runs/train/yolov5x_fold0_new/weights/
best.pt  last.pt
In [17]:
from PIL import Image
Image.open("yolov5/runs/train/yolov5x_fold0_new2/F1_curve.png")
Out[17]:
In [18]:
Image.open("yolov5/runs/train/yolov5x_fold0_new2/PR_curve.png")
Out[18]:

Prediction¶

In [19]:
!python yolov5/detect.py --weights yolov5/runs/train/yolov5x_fold0_new/weights/best.pt --img 676 --conf 0.6 --source /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images
detect: weights=['yolov5/runs/train/yolov5x_fold0_new/weights/best.pt'], source=/content/drive/MyDrive/workspace/Yolov5/new/data/testing_images, data=yolov5/data/coco128.yaml, imgsz=[676, 676], conf_thres=0.6, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=yolov5/runs/detect, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False, dnn=False, vid_stride=1
YOLOv5 🚀 v7.0-163-g016e046 Python-3.10.11 torch-2.0.0+cu118 CPU

Fusing layers... 
Model summary: 157 layers, 7012822 parameters, 0 gradients, 15.8 GFLOPs
WARNING ⚠️ --img-size [676, 676] must be multiple of max stride 32, updating to [704, 704]
image 1/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_25100.jpg: 416x704 (no detections), 275.8ms
image 2/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_25120.jpg: 416x704 (no detections), 273.7ms
image 3/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_25140.jpg: 416x704 (no detections), 267.3ms
image 4/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_25160.jpg: 416x704 (no detections), 269.2ms
image 5/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_25180.jpg: 416x704 (no detections), 267.6ms
image 6/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_25200.jpg: 416x704 (no detections), 282.9ms
image 7/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_25220.jpg: 416x704 (no detections), 273.6ms
image 8/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_25240.jpg: 416x704 (no detections), 254.4ms
image 9/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_25260.jpg: 416x704 (no detections), 268.4ms
image 10/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26320.jpg: 416x704 (no detections), 274.1ms
image 11/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26400.jpg: 416x704 (no detections), 274.9ms
image 12/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26420.jpg: 416x704 (no detections), 260.3ms
image 13/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26560.jpg: 416x704 1 car, 257.3ms
image 14/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26580.jpg: 416x704 1 car, 272.3ms
image 15/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26600.jpg: 416x704 (no detections), 257.5ms
image 16/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26620.jpg: 416x704 1 car, 406.1ms
image 17/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26640.jpg: 416x704 3 cars, 442.5ms
image 18/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26660.jpg: 416x704 1 car, 449.1ms
image 19/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26680.jpg: 416x704 2 cars, 435.9ms
image 20/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26700.jpg: 416x704 2 cars, 432.5ms
image 21/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26720.jpg: 416x704 3 cars, 448.6ms
image 22/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26740.jpg: 416x704 3 cars, 432.7ms
image 23/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26760.jpg: 416x704 3 cars, 431.7ms
image 24/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26780.jpg: 416x704 2 cars, 786.2ms
image 25/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26800.jpg: 416x704 3 cars, 669.4ms
image 26/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26820.jpg: 416x704 2 cars, 453.2ms
image 27/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26840.jpg: 416x704 1 car, 259.1ms
image 28/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26860.jpg: 416x704 1 car, 262.7ms
image 29/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26880.jpg: 416x704 1 car, 275.2ms
image 30/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26900.jpg: 416x704 2 cars, 257.0ms
image 31/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26920.jpg: 416x704 2 cars, 287.5ms
image 32/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26940.jpg: 416x704 2 cars, 273.8ms
image 33/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26960.jpg: 416x704 1 car, 260.9ms
image 34/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_26980.jpg: 416x704 (no detections), 261.3ms
image 35/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27240.jpg: 416x704 1 car, 266.7ms
image 36/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27260.jpg: 416x704 (no detections), 255.6ms
image 37/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27280.jpg: 416x704 (no detections), 256.3ms
image 38/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27300.jpg: 416x704 (no detections), 280.1ms
image 39/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27320.jpg: 416x704 1 car, 282.2ms
image 40/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27360.jpg: 416x704 1 car, 263.4ms
image 41/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27380.jpg: 416x704 (no detections), 265.2ms
image 42/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27400.jpg: 416x704 1 car, 284.3ms
image 43/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27420.jpg: 416x704 3 cars, 267.2ms
image 44/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27440.jpg: 416x704 3 cars, 262.4ms
image 45/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27460.jpg: 416x704 3 cars, 285.6ms
image 46/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27480.jpg: 416x704 3 cars, 271.9ms
image 47/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27500.jpg: 416x704 1 car, 272.9ms
image 48/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27520.jpg: 416x704 1 car, 297.0ms
image 49/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27540.jpg: 416x704 (no detections), 271.6ms
image 50/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27560.jpg: 416x704 (no detections), 254.8ms
image 51/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27580.jpg: 416x704 (no detections), 258.3ms
image 52/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27600.jpg: 416x704 (no detections), 296.7ms
image 53/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27620.jpg: 416x704 1 car, 265.3ms
image 54/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27640.jpg: 416x704 1 car, 268.6ms
image 55/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27660.jpg: 416x704 (no detections), 270.8ms
image 56/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27680.jpg: 416x704 (no detections), 272.7ms
image 57/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27700.jpg: 416x704 (no detections), 262.0ms
image 58/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27720.jpg: 416x704 (no detections), 290.2ms
image 59/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27740.jpg: 416x704 (no detections), 290.8ms
image 60/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27760.jpg: 416x704 (no detections), 414.2ms
image 61/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27780.jpg: 416x704 (no detections), 445.8ms
image 62/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27800.jpg: 416x704 (no detections), 477.5ms
image 63/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27820.jpg: 416x704 (no detections), 450.8ms
image 64/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27840.jpg: 416x704 1 car, 436.5ms
image 65/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27860.jpg: 416x704 1 car, 466.3ms
image 66/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27880.jpg: 416x704 1 car, 459.5ms
image 67/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27900.jpg: 416x704 1 car, 458.6ms
image 68/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27920.jpg: 416x704 1 car, 464.9ms
image 69/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27940.jpg: 416x704 (no detections), 451.8ms
image 70/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27960.jpg: 416x704 (no detections), 297.9ms
image 71/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_27980.jpg: 416x704 (no detections), 268.9ms
image 72/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28000.jpg: 416x704 (no detections), 269.4ms
image 73/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28020.jpg: 416x704 (no detections), 268.6ms
image 74/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28040.jpg: 416x704 (no detections), 265.5ms
image 75/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28060.jpg: 416x704 (no detections), 259.1ms
image 76/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28080.jpg: 416x704 (no detections), 296.3ms
image 77/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28180.jpg: 416x704 (no detections), 275.8ms
image 78/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28260.jpg: 416x704 1 car, 269.4ms
image 79/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28320.jpg: 416x704 (no detections), 265.3ms
image 80/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28340.jpg: 416x704 (no detections), 270.9ms
image 81/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28360.jpg: 416x704 (no detections), 270.9ms
image 82/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28380.jpg: 416x704 1 car, 273.8ms
image 83/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28420.jpg: 416x704 1 car, 270.4ms
image 84/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28440.jpg: 416x704 1 car, 270.7ms
image 85/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28460.jpg: 416x704 (no detections), 270.7ms
image 86/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28480.jpg: 416x704 (no detections), 273.9ms
image 87/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28500.jpg: 416x704 (no detections), 278.5ms
image 88/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28520.jpg: 416x704 (no detections), 264.1ms
image 89/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28540.jpg: 416x704 (no detections), 276.7ms
image 90/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28560.jpg: 416x704 (no detections), 268.5ms
image 91/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28580.jpg: 416x704 (no detections), 281.9ms
image 92/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28600.jpg: 416x704 (no detections), 274.6ms
image 93/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28620.jpg: 416x704 (no detections), 270.1ms
image 94/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28640.jpg: 416x704 (no detections), 283.5ms
image 95/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28660.jpg: 416x704 (no detections), 274.5ms
image 96/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28680.jpg: 416x704 (no detections), 281.7ms
image 97/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_28700.jpg: 416x704 (no detections), 275.6ms
image 98/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29000.jpg: 416x704 2 cars, 276.6ms
image 99/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29020.jpg: 416x704 1 car, 269.0ms
image 100/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29040.jpg: 416x704 1 car, 256.8ms
image 101/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29060.jpg: 416x704 (no detections), 268.5ms
image 102/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29080.jpg: 416x704 (no detections), 273.1ms
image 103/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29100.jpg: 416x704 (no detections), 294.5ms
image 104/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29400.jpg: 416x704 1 car, 445.0ms
image 105/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29420.jpg: 416x704 2 cars, 434.4ms
image 106/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29440.jpg: 416x704 2 cars, 445.7ms
image 107/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29460.jpg: 416x704 1 car, 451.8ms
image 108/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29480.jpg: 416x704 1 car, 439.6ms
image 109/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29500.jpg: 416x704 (no detections), 456.5ms
image 110/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29520.jpg: 416x704 (no detections), 436.5ms
image 111/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29540.jpg: 416x704 2 cars, 465.5ms
image 112/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29560.jpg: 416x704 1 car, 419.8ms
image 113/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29580.jpg: 416x704 1 car, 447.6ms
image 114/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29600.jpg: 416x704 (no detections), 266.1ms
image 115/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29620.jpg: 416x704 (no detections), 268.8ms
image 116/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29640.jpg: 416x704 (no detections), 318.1ms
image 117/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29720.jpg: 416x704 (no detections), 288.7ms
image 118/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29740.jpg: 416x704 (no detections), 267.8ms
image 119/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29760.jpg: 416x704 1 car, 286.4ms
image 120/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29820.jpg: 416x704 1 car, 266.7ms
image 121/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29840.jpg: 416x704 1 car, 256.7ms
image 122/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29860.jpg: 416x704 (no detections), 270.3ms
image 123/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29880.jpg: 416x704 (no detections), 282.9ms
image 124/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29900.jpg: 416x704 (no detections), 272.2ms
image 125/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_29980.jpg: 416x704 (no detections), 261.8ms
image 126/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30000.jpg: 416x704 (no detections), 278.2ms
image 127/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30020.jpg: 416x704 (no detections), 254.1ms
image 128/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30040.jpg: 416x704 (no detections), 255.1ms
image 129/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30120.jpg: 416x704 (no detections), 259.7ms
image 130/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30140.jpg: 416x704 (no detections), 274.2ms
image 131/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30160.jpg: 416x704 (no detections), 280.5ms
image 132/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30180.jpg: 416x704 (no detections), 271.3ms
image 133/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30640.jpg: 416x704 1 car, 271.2ms
image 134/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30660.jpg: 416x704 (no detections), 265.5ms
image 135/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30680.jpg: 416x704 (no detections), 258.0ms
image 136/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30700.jpg: 416x704 (no detections), 276.4ms
image 137/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30720.jpg: 416x704 (no detections), 294.6ms
image 138/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30740.jpg: 416x704 1 car, 260.1ms
image 139/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30760.jpg: 416x704 1 car, 264.4ms
image 140/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30820.jpg: 416x704 1 car, 274.5ms
image 141/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30840.jpg: 416x704 (no detections), 268.7ms
image 142/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30860.jpg: 416x704 1 car, 263.3ms
image 143/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30920.jpg: 416x704 1 car, 270.7ms
image 144/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_30940.jpg: 416x704 1 car, 285.4ms
image 145/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31020.jpg: 416x704 2 cars, 266.4ms
image 146/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31040.jpg: 416x704 2 cars, 265.1ms
image 147/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31060.jpg: 416x704 1 car, 329.0ms
image 148/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31080.jpg: 416x704 2 cars, 432.9ms
image 149/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31100.jpg: 416x704 2 cars, 447.3ms
image 150/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31120.jpg: 416x704 2 cars, 463.4ms
image 151/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31140.jpg: 416x704 1 car, 443.4ms
image 152/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31160.jpg: 416x704 1 car, 458.0ms
image 153/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31180.jpg: 416x704 (no detections), 458.3ms
image 154/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31200.jpg: 416x704 (no detections), 444.0ms
image 155/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31260.jpg: 416x704 (no detections), 437.7ms
image 156/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31280.jpg: 416x704 (no detections), 437.1ms
image 157/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31300.jpg: 416x704 (no detections), 416.0ms
image 158/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31360.jpg: 416x704 (no detections), 261.8ms
image 159/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31380.jpg: 416x704 (no detections), 275.1ms
image 160/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31400.jpg: 416x704 (no detections), 276.3ms
image 161/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31420.jpg: 416x704 (no detections), 277.4ms
image 162/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31480.jpg: 416x704 (no detections), 306.3ms
image 163/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31500.jpg: 416x704 (no detections), 267.7ms
image 164/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31520.jpg: 416x704 (no detections), 262.2ms
image 165/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31560.jpg: 416x704 1 car, 278.2ms
image 166/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31600.jpg: 416x704 2 cars, 279.8ms
image 167/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31620.jpg: 416x704 1 car, 271.3ms
image 168/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31640.jpg: 416x704 (no detections), 272.5ms
image 169/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31660.jpg: 416x704 (no detections), 271.6ms
image 170/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31680.jpg: 416x704 (no detections), 271.8ms
image 171/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31700.jpg: 416x704 1 car, 273.0ms
image 172/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_31720.jpg: 416x704 1 car, 264.9ms
image 173/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_400.jpg: 416x704 1 car, 279.2ms
image 174/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_420.jpg: 416x704 1 car, 264.4ms
image 175/175 /content/drive/MyDrive/workspace/Yolov5/new/data/testing_images/vid_5_440.jpg: 416x704 1 car, 266.5ms
Speed: 1.0ms pre-process, 316.0ms inference, 0.6ms NMS per image at shape (1, 3, 704, 704)
Results saved to yolov5/runs/detect/exp
In [20]:
predicted_files = []
for (dirpath, dirnames, filenames) in os.walk("./yolov5/runs/detect/exp"):
    predicted_files.extend(filenames)
In [21]:
Image.open(f'./yolov5/runs/detect/exp/{random.choice(predicted_files)}')
Out[21]:
In [22]:
Image.open(f'./yolov5/runs/detect/exp/{random.choice(predicted_files)}')
Out[22]:
In [23]:
Image.open(f'./yolov5/runs/detect/exp/{random.choice(predicted_files)}')
Out[23]:
In [24]:
Image.open(f'./yolov5/runs/detect/exp/{random.choice(predicted_files)}')
Out[24]:
In [25]:
Image.open(f'./yolov5/runs/detect/exp/{random.choice(predicted_files)}')
Out[25]:
In [26]:
Image.open(f'./yolov5/runs/detect/exp/{random.choice(predicted_files)}')
Out[26]:
In [27]:
Image.open(f'./yolov5/runs/detect/exp/{random.choice(predicted_files)}')
Out[27]:
In [31]:
Image.open(f'./yolov5/runs/detect/exp/{random.choice(predicted_files)}')
Out[31]:
In [30]:
Image.open(f'./yolov5/runs/detect/exp/{random.choice(predicted_files)}')
Out[30]:
In [29]:
Image.open(f'./yolov5/runs/detect/exp/{random.choice(predicted_files)}')
Out[29]: